package org.example.rabbitmqdemo.listener;

import org.example.rabbitmqdemo.constant.Constants;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.context.annotation.Configuration;

@Configuration
public class WorkListener {
    @RabbitListener(queues = Constants.WORK_QUEUE)
    public void queueListener(Message message){
        System.out.println("["+Constants.WORK_QUEUE+"]接收到消息"+message);
    }
}
